package sg.edu.nus.iss.phoenix.core.controller;

/**
 * Created by A0119952X.
 */
public class MessageBuilder {
    /**
     * messageType enum: Success, Info, Error
     */
    public static enum MessageType {
        Success,
        Info,
        Error
    }

    /**
     * helper class to parse string message to html based on messageType
     *
     * @param messageType
     * @param message
     * @return html message
     */
    public static String BuildMessage(MessageType messageType, String message) {
        switch (messageType) {
            case Success: {
                return "<h2 style=\"color:green; font-weight: bold; text-align:center;\">" + message + "</h2>";
            }
            case Info: {
                return "<h2 style=\"color:blue; font-weight: bold; text-align:center;\">" + message + "</h2>";
            }
            case Error: {
                return "<h2 style=\"color:red; font-weight: bold; text-align:center;\">" + message + "</h2>";
            }
        }
        return "";
    }
}
